{% extends "ad_template_base.html" %}
{% load staticfiles %}

{% block style %}
    <style>
        .tp4-wrapper {
            width: 100%;
            height: 101%;
            position: relative;
        }
        .tp4-full-img {
            width: 100%;
            height: 101%;
            margin-bottom: -5px;
        }
        .tp4-hot {
            margin: auto;
            position: absolute;
            top: 75%;
            left: 30%;
            bottom: 0;
            right: 30%;
            text-align: center;
            border-radius: 0px;
            width: 40%;
            height: 20%;
        }
    </style>
{% endblock %}

{% block content %}
    <div class="tp4-wrapper">
        <div class="tp4-center">
            <img class="tp4-full-img" id="ad_img" src="{{ ad_img }}" onerror="this.onerror=null;this.src='http://7xias2.com1.z0.glb.clouddn.com/default_720X1280.jpg'">
            <div class="tp4-hot" ad-hot="{{ ad_id_1 }}" ad-hot-action-type="{{ hot_action_type }}" ad-hot-action-param='{{ hot_action_param }}'></div>
        </div>
    </div>
{% endblock %}

{% block script %}
    <script type="text/javascript">
        var night = {% if night %} true {% else %} false {%  endif %};
        var oldOnLoad = window.onload || function () {};
        window.onload = function () {
            var content_dom = document.getElementsByClassName('tp4-center')[0];
            content_dom.style.height = document.documentElement.clientHeight + 'px';
            oldOnLoad();
        }
    </script>
{% endblock %}
